﻿using log4net;
using System;
using System.IO;
using System.Text;

namespace LogCentre
{
    public class RequestLog
    {
        private static readonly ILog logger = LogManager.GetLogger("requestLogger");
     
        static RequestLog()
        {
            //var path = @"C:\PGL\Config\log4net_config.xml";
            var path = AppDomain.CurrentDomain.BaseDirectory + @"Config\log4net_config.xml";

            //string path = new DirectoryInfo(string.Format(@"{0}..\Config\log4net_config.xml", AppDomain.CurrentDomain.BaseDirectory)).FullName;

            log4net.Config.XmlConfigurator.Configure(new FileInfo(path));

            //log4net.Config.XmlConfigurator.Configure();
        }

        public static void Debug(string msg)
        {
            logger.Debug(msg);
        }

        //public class UiLogEventArgs : EventArgs
        //{
        //    public string Message { get; private set; }
        //    public UiLogEventArgs(string message)
        //    {
        //        Message = message;
        //    }
        //}
    }
}
